package com.example.teaching_server.service;

import com.example.teaching_server.entity.ActivityCategory;
import com.example.teaching_server.repository.ActivityCategoryRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 活动相关服务
 */
@Slf4j
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class ActivityService {

    private final ActivityCategoryRepository activityCategoryRepository;

    /**
     * 获取所有活动分类
     */
    public List<ActivityCategory> getAllActivityCategories() {
        log.info("查询所有活动分类");
        return activityCategoryRepository.findAll();
    }
}
